extends Base1
@onready var player:CharacterBody2D=$"../.."
@onready var ani_spite:AnimatedSprite2D=$"../../AnimatedSprite2D"
@onready var attack_check = $"../../AttackCheck"
func enter():
	$Timer.stop()
	ani_spite.play("attack")

func do():
	var bodies = $"../../AttackCheck".get_overlapping_bodies()
	for body in bodies:
		if body.is_in_group("enemy"):
			body.take_hit(1)  # 假设每次攻击减少10点生命值

func exit():
	ani_spite.frame=0
	$"../../AnimatedSprite2D".stop()
	
func _on_animated_sprite_2d_animation_finished():
		$Timer.start(0.25)
		get_parent().change_state(0)
